import request from '@/config/axios'

export interface TenantOrderVO {
  id: number
  orderNo: string
  bizType: number
  bizNum: number
  totalAmount: number
  payStatus: number
  payOrderId: number
  ownerUserId: number
  payTime: Date
}

// 查询租户订单列表
export const getTenantOrderPageBySystem = async (params) => {
  return await request.get({ url: `/system/tenant-order/page-by-system`, params })
}

// 查询租户订单列表
export const getTenantOrderPage = async (params) => {
  return await request.get({ url: `/system/tenant-order/page`, params })
}

// 查询租户订单详情
export const getTenantOrder = async (id: number) => {
  return await request.get({ url: `/system/tenant-order/get?id=` + id })
}

// 新增租户订单
export const createTenantOrder = async (data: TenantOrderVO) => {
  return await request.post({ url: `/system/tenant-order/create`, data })
}

// 修改租户订单
export const updateTenantOrder = async (data: TenantOrderVO) => {
  return await request.put({ url: `/system/tenant-order/update`, data })
}

// 删除租户订单
export const deleteTenantOrder = async (id: number) => {
  return await request.delete({ url: `/system/tenant-order/delete?id=` + id })
}

// 导出租户订单 Excel
export const exportTenantOrder = async (params) => {
  return await request.download({ url: `/system/tenant-order/export-excel`, params })
}
//查看发货地址
export const getReceiverBySystem = async (id) => {
  return await request.get({ url: `/system/tenant-order/get-receiver-by-system?orderId=${id}` })
}
